(function() {

  jQuery(function($) {
    return $.getScript('http://tjs.sjs.sinajs.cn/open/api/js/wb.js?appkey=4276143701', function() {
      console.log('success');
      if (!window.USER_CONFIG) {
        return WB2.anyWhere(function(W) {
          return W.widget.connectButton({
            id: 'wb_connect_btn',
            type: '5,2',
            callback: {
              login: function(data) {
                var userInfo;
                console.log(data);
                userInfo = {
                  name: data.name,
                  location: data.location,
                  type: 'sinaWeibo',
                  id: data.id,
                  avatar: data.profile_image_url,
                  url: data.profile_url
                };
                return console.dir(userInfo);
              },
              logout: function() {
                return console.log('logout');
              }
            }
          });
        });
      }
    });
  });

}).call(this);
